package com.youbest.cloud.javacore.oop;

public class Employee {
	
	public Employee() {
		this.id = "001";
		this.name = "张三";
		this.age = 5;
		this.salary = 55555;
	}
	
	public Employee(String name,int age) {
		this.id = "002";
		this.name = name;
		this.age = age;
	}
	
	{
		this.name = "王二麻子";
		this.salary = 8888;
	}
	
	private String id;
	private String name;
	private int age;
	private double salary; 
	
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("{");
		sb.append("id:");
		sb.append(this.id);
		sb.append(",name:");
		sb.append(name);
		sb.append(",age:");
		sb.append(age);
		sb.append(",salary:");
		sb.append(salary);
		sb.append("}");
		
		return sb.toString();
	}
	
	public static void main(String[] args) {
		Employee e = new Employee();
		Employee e2 = new Employee("李四", 88);
		System.out.println(e);
		System.out.println(e2);
	}
}
